<template>
  <div class="container">
    <el-form :model="formList" ref="formList" size="medium">
      <div class="title">单位基本信息</div>
      <el-row :gutter="20">
        <el-col :span="8" :offset="0">
          <el-form-item label="单位名称">
            <el-input v-model="formList.name" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="统一社会信用代码">
            <el-input v-model="formList.zip_code"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="单位性质">
            <el-radio-group v-model="formList.type" size="normal" class="wid">
              <el-radio-button label="1">机关</el-radio-button>
              <el-radio-button label="2">事业</el-radio-button>
              <el-radio-button label="3">社会团体</el-radio-button>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8" :offset="0">
          <el-form-item label="上级主管单位">
            <el-input v-model="formList.master" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="单位地址">
            <el-input v-model="formList.address"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="财政业务支出处室">
            <el-input v-model="formList.remarks" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8" :offset="0">
          <el-form-item label="信息中心保障部门">
            <el-input v-model="formList.ensure_dept" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="保障部门负责人">
            <el-input v-model="formList.ensure_leader" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="联系电话">
            <el-input v-model="formList.ensure_leader_phone" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8" :offset="0">
          <el-form-item label="保障部门联系人">
            <el-input v-model="formList.ensure_user" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="联系电话">
            <el-input v-model="formList.ensure_user_phone" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <div class="title">本单位信息化管理部门信息</div>
      <el-row :gutter="20">
        <el-col :span="8" :offset="0">
          <el-form-item label="管理部门">
            <el-input v-model="formList.manager_dept"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="负责人姓名">
            <el-input v-model="formList.manager_leader"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="联系电话">
            <el-input v-model="formList.leader_mobile"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="8" :offset="0">
          <el-form-item label="联系人姓名">
            <el-input v-model="formList.linkman"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8" :offset="0">
          <el-form-item label="联系电话">
            <el-input v-model="formList.linkman_mobile"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div class="center">
      <el-button type="primary" size="default" @click="save" :loading="loading" v-if="user.no.length<=7">保存</el-button>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  name: '',
  components: {

  },
  props: {

  },
  data () {
    return {
      loading: false,
      formList: {},
    }
  },
  created () {

  },
  mounted () {
    this.init()
  },
  methods: {
    async init () {
      const res = await this.$http('sysAccountInfo', {
        code: this.user.company_code
      })
      this.formList = res
    },
    async save () {
      this.loading = true
      const res = await this.$http('sysAccountUp', {
        ...this.formList
      })
      this.$tips.success(res.errmsg)
      this.loading = false
      this.init()
    }
  },
  computed: {
    ...mapGetters([
      'user'
    ])
  }
}
</script>
<style lang='scss' scoped>
</style>
